﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SimpleActor
{
    public abstract class ActorServantBase : IActorServant
    {
        private IMessageHandler handler;

        void IActorServant.SetMessageHandler(IMessageHandler handler)
        {
            this.handler = handler;
        }

        protected IMessageHandler Handler
        {
            get { return handler; }
        }

        public virtual void OnStart()
        {
            // NOP
        }

        public abstract void Run();

        public virtual void OnStop()
        {
            // NOP
        }
    }
}
